﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;
using BusinessLogic.Dto;

namespace Services
{
    [ServiceContract(Namespace = "http://wgrus.com/Service", Name = "AccountingServices")]
    public interface IAccountingServices
    {
        /// <summary>
        /// This service gives you a uniq ordernumer within the entire WGRUS platform
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        int GetNextOrderNumber();
        
        /// <summary>
        /// This service checks the customer standing for the posted order, 
        /// and return a standing report
        /// </summary>
        /// <param name="orderXml">The format is documented in the 
        ///     AccountingOrder xml Schema
        /// </param>
        /// <returns>
        /// The Standing report contains:
        ///     int CustomerId - the customer Id
        ///     bool IsStandingValid - true if standing is valid. Else false
        ///     string BadStandingReason - if "bad standing" this string contains 
        ///     the reason (Exceded credit limit, unknown customer etc)
        /// </returns>
        [OperationContract]
        StandingReport IsStandingValid(string orderXml);
        
        /// <summary>
        /// When other systems updates customer information. 
        /// This is where you send this information.
        /// The service updates the customer info in the accounting system accordingly
        /// </summary>
        /// <param name="customerXml">The format is documented in the 
        ///     AccountingCustomer xml Schema</param>
        [OperationContract]
        CustomerUpdateReport UpdateCustomer(string customerXml);
        
        /// <summary>
        /// When the order is shiped you need to inform the accounting system by 
        /// caling this service
        /// </summary>
        /// <param name="orderXml">The format is documented in the 
        ///     AccountingCustomer xml Schema
        /// </param>
        [OperationContract]
        ShipOrderReport OrderShipped(string orderXml);
    }
}
